#ifndef CLOSUER_H
#define CLOSUER_H

#include "value.h"

typedef struct Upvalue
{
    TValue *value;
    u_short referenceCount;
} Upvalue;

typedef struct Closure
{
    ObjectHeader;
    Prototype *prototype;
    u_int cursor;
    TValue *virtualRegister;
    TValue result;
    Upvalue **upvalue;
} Closure;

void Closure_Init(Closure *function, Line *line, Prototype *prototype);

#endif